/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gradehorario;

/**
 *
 * @author rafaelneri
 */
public class ItemLeilao extends Item {
    private Lance _lance;
    
    public ItemLeilao(String nome, float preco){
        super(nome, preco);
    }
    
    public float getValorLance()
    {
        return this._lance.getValor();
    }
    
    public Lance getLanceVencedor(){
        return this._lance;
    }
    
    public void setLance(Lance lance){
        if(lance.getValor() > this._lance.getValor())
        {
            this._lance = lance;
        }
    }
    
    public Item getItemAVenda(){
        Item item = new Item(this.getNome(), this.getValorLance());
        return item;
    }
}
